<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
  <head>
    <title></title>
  </head>
  <body>
  <%
    if (request.getAttribute("list") == null) {
      request.getRequestDispatcher("ListServlet").forward(request, response);
    }
  %>
  <table>
    <a href="addRent.jsp">添加</a>
    <tr style="background-color: #87888A" align="center">
      <th>租赁人姓名</th>
      <th>车牌号</th>
      <th>租赁状态</th>
      <th>到期日期</th>
      <th>操作</th>
    </tr>
    <c:forEach items="${list}" varStatus="status" var="jin">
      <tr align="center" style="background-color: ${status.index % 2 == 0 ? '':'#BDBEC2'}">
        <td>${jin.userName}</td>
        <td>${jin.carNum}</td>
        <td>${jin.status == 0 ? "租赁中":"已到期"}</td>
        <td>${jin.maturityDale}</td>
        <td>
            <a href="DelRentServlet?id=${jin.id}">删除</a>
            <a href="IdServlet?id=${jin.id}">修改</a>
        </td>
      </tr>
    </c:forEach>
  </table>
  <p>
    <a href="ListServlet?currPage=${param.currPage-1}">上一页</a>
    <a href="ListServlet?currPage=${param.currPage+1}">下一页</a>
  </p>
  </body>
</html>